//
// NeL - bindings
// Copyright (C) 2010 Naush
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU Affero General Public License as
//published by the Free Software Foundation, either version 3 of the
//License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU Affero General Public License for more details.
//
//You should have received a copy of the GNU Affero General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.ryzom.nel.misc;

public class CAABBox {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CAABBox(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CAABBox obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nelmiscJNI.delete_CAABBox(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CAABBox() {
    this(nelmiscJNI.new_CAABBox(), true);
  }

  public void setCenter(CVector center) {
    nelmiscJNI.CAABBox_setCenter(swigCPtr, this, CVector.getCPtr(center), center);
  }

  public void setHalfSize(CVector hs) {
    nelmiscJNI.CAABBox_setHalfSize(swigCPtr, this, CVector.getCPtr(hs), hs);
  }

  public void setSize(CVector s) {
    nelmiscJNI.CAABBox_setSize(swigCPtr, this, CVector.getCPtr(s), s);
  }

  public void setMinMax(CVector bmin, CVector bmax) {
    nelmiscJNI.CAABBox_setMinMax(swigCPtr, this, CVector.getCPtr(bmin), bmin, CVector.getCPtr(bmax), bmax);
  }

  public void extend(CVector v) {
    nelmiscJNI.CAABBox_extend(swigCPtr, this, CVector.getCPtr(v), v);
  }

  public CVector getMin() {
    return new CVector(nelmiscJNI.CAABBox_getMin__SWIG_0(swigCPtr, this), true);
  }

  public CVector getMax() {
    return new CVector(nelmiscJNI.CAABBox_getMax__SWIG_0(swigCPtr, this), true);
  }

  public void getMin(CVector ret) {
    nelmiscJNI.CAABBox_getMin__SWIG_1(swigCPtr, this, CVector.getCPtr(ret), ret);
  }

  public void getMax(CVector ret) {
    nelmiscJNI.CAABBox_getMax__SWIG_1(swigCPtr, this, CVector.getCPtr(ret), ret);
  }

  public CVector getCenter() {
    return new CVector(nelmiscJNI.CAABBox_getCenter(swigCPtr, this), false);
  }

  public CVector getHalfSize() {
    return new CVector(nelmiscJNI.CAABBox_getHalfSize(swigCPtr, this), false);
  }

  public CVector getSize() {
    return new CVector(nelmiscJNI.CAABBox_getSize__SWIG_0(swigCPtr, this), true);
  }

  public void getSize(CVector ret) {
    nelmiscJNI.CAABBox_getSize__SWIG_1(swigCPtr, this, CVector.getCPtr(ret), ret);
  }

  public float getRadius() {
    return nelmiscJNI.CAABBox_getRadius(swigCPtr, this);
  }

  public boolean clipFront(CPlane p) {
    return nelmiscJNI.CAABBox_clipFront(swigCPtr, this, CPlane.getCPtr(p), p);
  }

  public boolean clipBack(CPlane p) {
    return nelmiscJNI.CAABBox_clipBack(swigCPtr, this, CPlane.getCPtr(p), p);
  }

  public boolean include(CVector a) {
    return nelmiscJNI.CAABBox_include__SWIG_0(swigCPtr, this, CVector.getCPtr(a), a);
  }

  public boolean include(CAABBox box) {
    return nelmiscJNI.CAABBox_include__SWIG_1(swigCPtr, this, CAABBox.getCPtr(box), box);
  }

  public boolean intersect(CAABBox box) {
    return nelmiscJNI.CAABBox_intersect__SWIG_0(swigCPtr, this, CAABBox.getCPtr(box), box);
  }

  public boolean intersect(CVector a, CVector b, CVector c) {
    return nelmiscJNI.CAABBox_intersect__SWIG_1(swigCPtr, this, CVector.getCPtr(a), a, CVector.getCPtr(b), b, CVector.getCPtr(c), c);
  }

  public boolean intersect(CBSphere s) {
    return nelmiscJNI.CAABBox_intersect__SWIG_2(swigCPtr, this, CBSphere.getCPtr(s), s);
  }

  public boolean intersect(CVector a, CVector b) {
    return nelmiscJNI.CAABBox_intersect__SWIG_3(swigCPtr, this, CVector.getCPtr(a), a, CVector.getCPtr(b), b);
  }

  public boolean clipSegment(CVector a, CVector b) {
    return nelmiscJNI.CAABBox_clipSegment(swigCPtr, this, CVector.getCPtr(a), a, CVector.getCPtr(b), b);
  }

  public void makePyramid(CPlane planes) {
    nelmiscJNI.CAABBox_makePyramid(swigCPtr, this, CPlane.getCPtr(planes), planes);
  }

  public static CAABBox computeAABBoxUnion(CAABBox b1, CAABBox b2) {
    return new CAABBox(nelmiscJNI.CAABBox_computeAABBoxUnion(CAABBox.getCPtr(b1), b1, CAABBox.getCPtr(b2), b2), true);
  }

  public void computeIntersection(CAABBox b1, CAABBox b2) {
    nelmiscJNI.CAABBox_computeIntersection(swigCPtr, this, CAABBox.getCPtr(b1), b1, CAABBox.getCPtr(b2), b2);
  }

  public static CAABBox transformAABBox(CMatrix mat, CAABBox box) {
    return new CAABBox(nelmiscJNI.CAABBox_transformAABBox(CMatrix.getCPtr(mat), mat, CAABBox.getCPtr(box), box), true);
  }

  public void serial(IStream f) {
    nelmiscJNI.CAABBox_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

}
